package com.example.lib_apply

import android.graphics.Color
import com.blankj.utilcode.util.TimeUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class ApplyAdapter : BaseQuickAdapter<ApplyEntity,BaseViewHolder>(R.layout.item_myapply){
    override fun convert(holder: BaseViewHolder, item: ApplyEntity) {
        holder.setText(R.id.item_startDate,item.startTime+"")
        holder.setText(R.id.item_end_date,item.endTime+"")
        when(item.type.toInt()){
            0 ->{
                holder.setText(R.id.item_visitor_title,"来访申请")
                holder.setBackgroundColor(R.id.item_bg,Color.parseColor("#A8E067"))
            }
            1 ->{
                holder.setText(R.id.item_visitor_title,"车位申请")
                holder.setBackgroundColor(R.id.item_bg,Color.parseColor("#e2ae73"))
            }
            2 ->{
                holder.setText(R.id.item_visitor_title,"报修申请")
                holder.setBackgroundColor(R.id.item_bg,Color.parseColor("#FF6B6B"))
            }
            3 ->{
                holder.setText(R.id.item_visitor_title,"巡逻申请")
            }
        }
    }
}